/**
 * @Description: 附件API
 * @Author: Zander
 * @Date: 2023/1/31 11:01
 * @LastEditors: Zander
 * @LastEditTime: 2023/1/31 11:01
 */

import { $post, $upload } from '@api/utils';
import { fileApi, systemApi } from '@/config/prefix';

export const apiUploadFiles = (data) => $upload({
  url: `${fileApi}/uploadFiles`,
  timeout: 10 * 60 * 1000,
  ...data
})
/**
 * 批量查询
 * @param ids
 * @returns {Promise<minimist.Opts.unknown>}
 */
export const apiServerFiles = (ids) => $post({
  url: `${systemApi}/cadeEnclosure/serverFiles`,
  timeout: 10 * 60 * 1000,
  data: { ids: ids }
});

/**
 * 批量逻辑删除
 * @param ids
 * @returns {Promise<minimist.Opts.unknown>}
 */
export const apiLogicBatchDeleteByIds = (ids) => $post({
  url: `${systemApi}/cadeEnclosure/logicBatchDeleteByIds`,
  data: { ids: ids }
});

/**
 * 根据bizId查询附件集合
 * @param bizId
 * @param bizType
 * @returns {Promise<minimist.Opts.unknown>}
 */
export const apiSearchListByBizId = (bizId, bizType) => $get({
  url: `${systemApi}/cadeEnclosure/searchListByBizId`,
  params: { bizId: bizId, bizType: bizType }
});
